﻿using System.IO;
using yunio;
using yunio._req_http;

namespace ConsoleApp1
{
    internal class Program
    {
        static void Main(string[] args)
        {
            //var uri = "https://api.tozhang.cn/tazi/home";
            //var w = YunioHttp.GetText(uri);
            //YunioHttp.DownloadToFile("https://api.tozhang.cn/tazi/static/media/a4.ccdd2689.png", "tazi.png");
            ;

            var c = new MultiContent();
            using var f = File.OpenRead(@"C:\Users\zhang\Downloads\basic-miktex-24.1-x64.exe");

            c.AddStreamContent("basic-miktex-24.1-x64.exe/1/2", f, 0, (int)(f.Length/12));
            YunioHttp.Upload("http://127.0.0.1:1000/fspace/set", c);
            var c2 = new MultiContent();
            c2.AddStreamContent("basic-miktex-24.1-x64.exe/2/2", f, f.Length / 2, (int)(f.Length/12));
            YunioHttp.Upload("http://127.0.0.1:1000/fspace/set", c2);
        }

    }
}
